package com.liqi.frame.comm.po;

import com.liqi.frame.comm.util.ArithUtil;

/**
 * CPU相关信息
 *
 */
public class Cpu
{
    /**
     * 核心数
     */
    private Integer cpuNum;

    /**
     * CPU总的使用率
     */
    private Double total=0.0;

    /**
     * CPU系统使用率
     */
    private Double sys;

    /**
     * CPU用户使用率
     */
    private Double used;

    /**
     * CPU当前等待率
     */
    private Double wait=0.0;

    /**
     * CPU当前空闲率
     */
    private Double free;

    public Integer getCpuNum()
    {
        return cpuNum;
    }

    public void setCpuNum(int cpuNum)
    {
        this.cpuNum = cpuNum;
    }

    public Double getTotal()
    {
        return ArithUtil.round(ArithUtil.mul(total, 100), 2);
    }

    public void setTotal(Double total)
    {
        this.total = total;
    }

    public Double getSys()
    {
        return ArithUtil.round(ArithUtil.mul(sys / total, 100), 2);
    }

    public void setSys(Double sys)
    {
        this.sys = sys;
    }

    public Double getUsed()
    {
        return ArithUtil.round(ArithUtil.mul(used / total, 100), 2);
    }

    public void setUsed(Double used)
    {
        this.used = used;
    }

    public Double getWait()
    {
        return ArithUtil.round(ArithUtil.mul(wait / total, 100), 2);
    }

    public void setWait(Double wait)
    {
        this.wait = wait;
    }

    public Double getFree()
    {
        return ArithUtil.round(ArithUtil.mul(free / total, 100), 2);
    }

    public void setFree(Double free)
    {
        this.free = free;
    }
}
